/**
 * return template for the function file
 * each info begin with //**-// (no - )
 * split key and value with :
 */
function generateFileContent({key,name,remark,code,doc}) {
    doc = (doc && JSON.parse(doc)) || {}
    for(let i in doc){
        doc[i] = JSON.stringify(doc[i])
    }
    const template = `//**// key::${key}
//**// name::${name}
//**// remark::${remark}
//**// params::${doc.params || ''}
//**// returns::${doc.returns || ''}
//**// examples::${doc.examples || ''}
//**// description::${doc.description || ''}
//**// code::
${code}
`
    return template
}
module.exports.generateFileContent = generateFileContent
